#include "main.hh"

int main() {

    std::vector<ICharacter*> hero_team;
    std::vector<ICharacter*> enemy_team;

    hero_team = gamefunction::selectHeroes();
    Iroom* room;

    for (int i = 0; i < 5; i++)
    {   
        if (!hero_team.empty()) {
            IO::clearTerminal();
            std::cout << "There's " << 5 - i << " fight to finsh...\n";
            IO::getString("Enter anyting to continue.\n");
            room = new rooms::fight_room();
            room->event(hero_team);
            delete room;
            room = nullptr;
            if (randomFunc::get_persent_bool(50)) {
                room = new rooms::spring_room();
            } else {
                room = new rooms::empty_room();
            }
            room->event(hero_team);
            delete room;
            room = nullptr;
            room = new rooms::item_room();
            room->event(hero_team);
            delete room;
            room = nullptr;
        }

    }

    if (!hero_team.empty()) {
        for (auto* obj : hero_team) delete obj;
        hero_team.clear();
        IO::clearTerminal();
        std::cout << "You finsh the game!";
    }

    // 释放 hero_team 内存

    return 0;
}